var tdtToken = "203f15b369305c12dfec7578acb2c214";
window.mapConfig = {
  watermarkname: "乌鲁木齐市",
  watermarkwidth: 20,
  xzqhname: "天山区",
  env: "kcy",
  // psmUrl: "http://geoscene.asuscomm.com:9080/mdbj-admin",
  // psmUrl: "http://localhost:9999",
  psmUrl: "http://192.168.10.156:9997",
  // psmUrl: "http://localhost:9997",
  tomcatUrl: "http://192.168.10.156:8080",
  nodeurl: "http://192.168.10.156:5005/greencityldzb-server",
  fontsurl: "http://localhost:85/assets/arcgisFont",
  furl: "http://192.168.10.156:8080/greencity/assets/arcgisFont",
  assetsPathurl: "http://localhost:85/assets",
  assetsurl: "http://192.168.10.156:8080/greencity/assets",
  themeChalkUrl:
    "http://192.168.10.156:8080/greencity/assets/theme-chalk/index.css",
  themeChalkDevUrl: "http://localhost:85/assets/theme-chalk/index.css",
  // // 用于城市绿化覆盖率、城市绿地率统计的米东区总面积
  // totalArea: 117714830.95594325,
  // // 用于人均绿地面积、人均公园绿地面积统计的总人口数
  // totalPopulation: 281394,
  //   mapcenter4490: [85.51, 42.24],
  //87.614396, 43.821551   乌鲁木齐中心点
  //87.634738, 43.923643  米泉普查测试区域中心点
  // 地图默认中心点
  mapcenter: {
    //米东
    // x: 552152,
    // y: 4869975,
    //天山区
    // x: 550228,
    // y: 4851093,
    //水区
    // x: 549643,
    // y: 4854961,
    //甘泉堡
    x: 561643,
    y: 4889961,
    // z: 3500000,
    spatialReference: {
      // wkid: 4490,
      wkt: 'PROJCS["CGCS2000_wlmq",GEOGCS["GCS_China_Geodetic_Coordinate_System_2000",DATUM["D_China_2000",SPHEROID["CGCS2000",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",87.5],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]]',
    },
  },
  center: [552152, 4869975],
  // 地图初始显示级别
  zoom: 12,
  scale: 9000,
  fullExtent: {
    //全图范围
    xmin: 13026179.382488998,
    ymin: 2677291.306672236,
    xmax: 13044409.613734988,
    ymax: 2685919.1362399133,
  },
  //初始化范围
  extent: {
    xmin: 7000000,
    xmax: 12000000,
    ymax: 6000000,
    ymin: 3400000,
  },

  baseMapLayers: {
    // 影像底图
    imageLayer: {
      type: "tile",
      url: "http://192.168.10.72/arcgis/rest/services/BaseMap/YX_WLMQ_202209_WLMQ2000/MapServer",
    },

    // 影像注记
    imageAnoLayer: {
      type: "tile",
      url: "http://192.168.10.72/arcgis/rest/services/BaseMap/YXZJ_WLMQ_202209_WLMQ2000/MapServer",
    },
    // 矢量底图
    vectorLayer: {
      type: "tile",
      url: "http://192.168.10.72/arcgis/rest/services/BaseMap/SL_202308_WLMQ2000/MapServer",
    },
    // 矢量注记
    vectorAnoLayer: {
      type: "tile",
      url: "http://192.168.10.72/arcgis/rest/services/BaseMap/SLZJ_202308_WLMQ2000/MapServer",
    },
    tdtLayer: {
      // 影像底图
      img_c:
        "http://{subDomain}.tianditu.com/img_c/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=img&STYLE=default&FORMAT=tiles&TILEMATRIXSET=c&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=" +
        tdtToken,
      cia_c:
        "http://{subDomain}.tianditu.com/cia_c/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=cia&STYLE=default&FORMAT=tiles&TILEMATRIXSET=c&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=" +
        tdtToken,
      cia_w:
        "http://{subDomain}.tianditu.com/cia_w/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=cia&STYLE=default&FORMAT=tiles&TILEMATRIXSET=w&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=" +
        tdtToken,
      vec_c:
        "http://{subDomain}.tianditu.gov.cn/vec_c/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=vec&STYLE=default&FORMAT=tiles&TILEMATRIXSET=c&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=" +
        tdtToken,
      cva_c:
        "http://{subDomain}.tianditu.gov.cn/cva_c/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=cva&STYLE=default&FORMAT=tiles&TILEMATRIXSET=c&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=" +
        tdtToken,
      ter_c:
        "http://{subDomain}.tianditu.gov.cn/ter_c/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=ter&STYLE=default&FORMAT=tiles&TILEMATRIXSET=c&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=" +
        tdtToken,
    },
  },
  tdtPoiUrl: `http://api.tianditu.gov.cn/v2/search?postStr={"keyWord":"skeyword","level":18,"queryType":7,"mapBound":"87.22736557022095,44.12267698757833,88.5155125428772,43.19475072591678","start":0,"specify":"156650100","count":10}&type=query&tk=${tdtToken}`,
  tdtTileInfo: {
    size: 256,
    origin: {
      x: -180,
      y: 90,
    },
    spatialReference: {
      wkid: 4490,
    },
    lods: [
      {
        level: 0,
        levelValue: 1,
        resolution: 0.703125,
        scale: 295497593.05875003,
      },
      {
        level: 1,
        levelValue: 2,
        resolution: 0.3515625,
        scale: 147748796.52937502,
      },
      {
        level: 2,
        levelValue: 3,
        resolution: 0.17578125,
        scale: 73874398.264687508,
      },
      {
        level: 3,
        levelValue: 4,
        resolution: 0.087890625,
        scale: 36937199.132343754,
      },
      {
        level: 4,
        levelValue: 5,
        resolution: 0.0439453125,
        scale: 18468599.566171877,
      },
      {
        level: 5,
        levelValue: 6,
        resolution: 0.02197265625,
        scale: 9234299.7830859385,
      },
      {
        level: 6,
        levelValue: 7,
        resolution: 0.010986328125,
        scale: 4617149.8915429693,
      },
      {
        level: 7,
        levelValue: 8,
        resolution: 0.0054931640625,
        scale: 2308574.9457714846,
      },
      {
        level: 8,
        levelValue: 9,
        resolution: 0.00274658203125,
        scale: 1154287.4728857423,
      },
      {
        level: 9,
        levelValue: 10,
        resolution: 0.001373291015625,
        scale: 577143.73644287116,
      },
      {
        level: 10,
        levelValue: 11,
        resolution: 0.0006866455078125,
        scale: 288571.86822143558,
      },
      {
        level: 11,
        levelValue: 12,
        resolution: 0.00034332275390625,
        scale: 144285.93411071779,
      },
      {
        level: 12,
        levelValue: 13,
        resolution: 0.000171661376953125,
        scale: 72142.967055358895,
      },
      {
        level: 13,
        levelValue: 14,
        resolution: 8.58306884765625e-5,
        scale: 36071.483527679447,
      },
      {
        level: 14,
        levelValue: 15,
        resolution: 4.291534423828125e-5,
        scale: 18035.741763839724,
      },
      {
        level: 15,
        levelValue: 16,
        resolution: 2.1457672119140625e-5,
        scale: 9017.8708819198619,
      },
      {
        level: 16,
        levelValue: 17,
        resolution: 1.0728836059570313e-5,
        scale: 4508.9354409599309,
      },
      {
        level: 17,
        levelValue: 18,
        resolution: 5.3644180297851563e-6,
        scale: 2254.4677204799655,
      },
      {
        level: 18,
        levelValue: 19,
        resolution: 2.68220901489257815e-6,
        scale: 1127.23386023998275,
      },
      {
        level: 19,
        levelValue: 20,
        resolution: 1.341104507446289075e-6,
        scale: 563.616930119991375,
      },
    ],
  },
  tdtSubDomains: ["t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7"],
  // 高程服务
  elevationLayer:
    "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",
  /**
   * 类型枚举
   * 切片服务：tile
   * 动态服务：map-image
   * 场景服务：scene
   * bim服务：building-scene
   * 要素服务：feature
   * DEM服务：demserver
   * 倾斜服务：
   * 天地图服务:tdt-tile
   */
  // xzqhLayer: {
  //   id: "xzqh",
  //   title: "行政区划",
  //   url: "http://192.168.10.72/arcgis/rest/services/citygreen/greencity/MapServer/0",
  //   symbol: {
  //     type: "simple-fill",
  //     color: [20, 130, 200, 0.3],
  //     outline: {
  //       color: "white",
  //       width: 2,
  //     },
  //   },
  // },
  operationLayers: {
    mapservers: {
      xzqhlayer: {
        id: "xzqhlayer",
        title: "行政区划",
        url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/MapServer/0",
        type: "feature",
        sublayerId: 1,
        visible: true,
        popupEnabled: false,
        opacity: 1,
        order: 2,
        symbol: {
          type: "simple-fill",
          color: [20, 130, 200, 0.5],
          outline: {
            color: "white",
            width: 0.5,
          },
        },
      },
      citykfbjlayer: {
        id: "citykfbjlayer",
        title: "城镇开发边界",
        url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/MapServer/1",
        type: "feature",
        sublayerId: 1,
        visible: false,
        popupEnabled: false,
        opacity: 1,
        order: 2,
        symbol: {
          type: "simple-fill",
          color: [20, 130, 200, 0.5],
          outline: {
            color: "white",
            width: 0.5,
          },
        },
      },
      reigonlayer: {
        id: "reigonlayer",
        title: "绿地范围",
        url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/2",
        type: "feature",
        visible: false,
        opacity: 1,
        order: 0,
        outFields: ["objectid", "name", "category_type", "hczt"],
        // zoomLevel: 17,
        symbol: {
          type: "simple-fill",
          color: [20, 130, 200, 0.5],
          outline: {
            color: [255, 255, 0],
            width: 2,
          },
        },
      },
      citylvdaolayer: {
        id: "citylvdaolayer",
        title: "城市绿道",
        url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/7",
        type: "feature",
        visible: false,
        opacity: 1,
        order: 1,
        outFields: ["objectid", "name", "swidth", "hczt", "slen"],
        // zoomLevel: 17,
        symbol: {
          type: "simple-fill",
          color: [20, 130, 200, 0.5],
          outline: {
            color: [255, 255, 0],
            width: 2,
          },
        },
      },
      gusmmlayer: {
        id: "gusmmlayer",
        title: "古树名木",
        url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/6",
        type: "feature",
        visible: false,
        opacity: 1,
        order: 0,
      },
      // 点状绿地
      dianzldlayer: {
        id: "dianzldlayer",
        title: "点状绿地",
        url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/5",
        type: "feature",
        visible: false,
        opacity: 1,
        order: 1,
      },
      qitaldlayer: {
        id: "qitaldlayer",
        title: "其他绿地",
        url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/4",
        type: "feature",
        sublayerId: 1,
        visible: false,
        opacity: 1,
        order: 2,
      },
      roadldlayer: {
        id: "roadldlayer",
        title: "行道树",
        url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/3",
        type: "feature",
        sublayerId: 1,
        visible: false,
        opacity: 1,
        order: 2,
      },
      // greencity: {
      //   id: "greencity",
      //   title: "园林城市",
      //   url: "http://192.168.1.101:6080/geoscene/rest/services/citygreen/MapServer",
      //   type: "mapimage",
      //   sublayerId: 1,
      //   visible: true,
      //   popupEnabled: false,
      //   opacity: 1,
      //   order: 2,
      //   symbol: {
      //     type: "simple-fill",
      //     // color: [20, 130, 200, 0.5],
      //     outline: {
      //       color: "white",
      //       width: 0.5,
      //     },
      //   },
      // },
    },
    // featurelayers: {
    //   reigonlayer: {
    //     id: "reigonlayer",
    //     title: "绿地范围",
    //     url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/2",
    //     type: "feature",
    //     visible: true,
    //     opacity: 1,
    //     order: 0,
    //     outFields: ["objectid", "name", "category_type", "hczt"],
    //     // zoomLevel: 17,
    //     symbol: {
    //       type: "simple-fill",
    //       color: [20, 130, 200, 0.5],
    //       outline: {
    //         color: [255, 255, 0],
    //         width: 2,
    //       },
    //     },
    //   },
    //   citylvdaolayer: {
    //     id: "citylvdaolayer",
    //     title: "城市绿道",
    //     url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/7",
    //     type: "feature",
    //     visible: true,
    //     opacity: 1,
    //     order: 1,
    //     outFields: ["objectid", "name", "swidth", "hczt", "slen"],
    //     // zoomLevel: 17,
    //     symbol: {
    //       type: "simple-fill",
    //       color: [20, 130, 200, 0.5],
    //       outline: {
    //         color: [255, 255, 0],
    //         width: 2,
    //       },
    //     },
    //   },
    //   gusmm: {
    //     id: "gusmmlayer",
    //     title: "古树名木",
    //     url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/6",
    //     type: "feature",
    //     visible: true,
    //     opacity: 1,
    //     order: 0,
    //   },
    //   // 点状绿地
    //   dianzld: {
    //     id: "dianzldlayer",
    //     title: "点状绿地",
    //     url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/5",
    //     type: "feature",
    //     visible: true,
    //     opacity: 1,
    //     order: 1,
    //   },
    //   qitald: {
    //     id: "qitaldlayer",
    //     title: "其他绿地",
    //     url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/4",
    //     type: "feature",
    //     sublayerId: 1,
    //     visible: true,
    //     opacity: 1,
    //     order: 2,
    //   },
    //   roadld: {
    //     id: "roadldlayer",
    //     title: "行道树",
    //     url: "http://192.168.10.72/arcgis/rest/services/citygreen/citygreen/FeatureServer/3",
    //     type: "feature",
    //     sublayerId: 1,
    //     visible: true,
    //     opacity: 1,
    //     order: 2,
    //   },
    // },
  },
  symbols: {
    // 框选查询的框符号
    selectExtent: {
      type: "simple-fill",
      color: [227, 139, 79, 0.6],
      outline: {
        color: "#722620",
        width: 3,
      },
    },
    //
    pointLocate: {
      type: "simple-marker",
      style: "circle",
      // color: "orange",
      size: "20px", // pixels
      outline: {
        // autocasts as new SimpleLineSymbol()
        color: [0, 255, 255],
        width: 2, // points
      },
    },
    polygonLocate: {
      type: "simple-fill",
      color: [20, 130, 200, 0.5],
      outline: {
        color: [0, 255, 255],
        width: 2,
      },
    },
    polylineLocate: {
      type: "simple-line",
      cap: "round",
      color: [0, 122, 194, 1],
      join: "round",
      miterLimit: 1,
      style: "solid",
      width: 2,
    },
    // 高亮颜色配置 bright yellow colors
    highlightOptions: {
      color: [255, 255, 0, 1],
      haloOpacity: 0.9,
      fillOpacity: 0.2,
    },
  },
};
